<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>元素表单</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/css/bootstrap.min.css">
    <style>
        .form-container {
            max-width: 800px;
            margin: 20px auto;
            padding: 20px;
            background-color: #fff;
            border-radius: 4px;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        }
        
        .info-box {
            background-color: #e3f2fd;
            padding: 15px;
            margin-bottom: 20px;
            border-radius: 4px;
        }
        
        .form-group label {
            font-weight: 500;
            width: 120px;
            text-align: right;
            margin-right: 15px;
        }
        
        .switch {
            position: relative;
            display: inline-block;
            width: 60px;
            height: 34px;
        }
        
        .switch input {
            opacity: 0;
            width: 0;
            height: 0;
        }
        
        .slider {
            position: absolute;
            cursor: pointer;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: #ccc;
            transition: .4s;
            border-radius: 34px;
        }
        
        .slider:before {
            position: absolute;
            content: "";
            height: 26px;
            width: 26px;
            left: 4px;
            bottom: 4px;
            background-color: white;
            transition: .4s;
            border-radius: 50%;
        }
        
        input:checked + .slider {
            background-color: #2196F3;
        }
        
        input:checked + .slider:before {
            transform: translateX(26px);
        }
    </style>
</head>
<body>
    <div class="form-container">
        <div class="info-box">
            拖拽左侧的表单元素到右侧区域，即可生成相应的HTML代码，表单代码，轻松搞定！
        </div>
        
        <form>
            <div class="form-group row">
                <label>文本框：</label>
                <div class="col-sm-8">
                    <input type="text" class="form-control" placeholder="请输入文本">
                </div>
            </div>
            
            <div class="form-group row">
                <label>多行文本框：</label>
                <div class="col-sm-8">
                    <textarea class="form-control" rows="3" placeholder="请输入文本"></textarea>
                </div>
            </div>
            
            <div class="form-group row">
                <label>密码框：</label>
                <div class="col-sm-8">
                    <input type="password" class="form-control" placeholder="请输入密码">
                </div>
            </div>
            
            <div class="form-group row">
                <label>下拉框：</label>
                <div class="col-sm-8">
                    <select class="form-control">
                        <option>选项1</option>
                        <option>选项2</option>
                        <option>选项3</option>
                    </select>
                </div>
            </div>
            
            <div class="form-group row">
                <label>纯文本：</label>
                <div class="col-sm-8">
                    <span>这里是纯文本信息</span>
                </div>
            </div>
            
            <div class="form-group row">
                <label>单选框：</label>
                <div class="col-sm-8">
                    <div class="form-check form-check-inline">
                        <input class="form-check-input" type="radio" name="radioOptions" checked>
                        <label class="form-check-label">选项1</label>
                    </div>
                    <div class="form-check form-check-inline">
                        <input class="form-check-input" type="radio" name="radioOptions">
                        <label class="form-check-label">选项2</label>
                    </div>
                </div>
            </div>
            
            <div class="form-group row">
                <label>复选框：</label>
                <div class="col-sm-8">
                    <div class="form-check form-check-inline">
                        <input class="form-check-input" type="checkbox">
                        <label class="form-check-label">选项1</label>
                    </div>
                    <div class="form-check form-check-inline">
                        <input class="form-check-input" type="checkbox">
                        <label class="form-check-label">选项2</label>
                    </div>
                    <div class="form-check form-check-inline">
                        <input class="form-check-input" type="checkbox">
                        <label class="form-check-label">选项3</label>
                    </div>
                </div>
            </div>
            
            <div class="form-group row">
                <label>切换按钮：</label>
                <div class="col-sm-8">
                    <label class="switch">
                        <input type="checkbox">
                        <span class="slider"></span>
                    </label>
                </div>
            </div>
            
            <div class="form-group row">
                <label>日期选择：</label>
                <div class="col-sm-8">
                    <input type="date" class="form-control" value="2018-04-20">
                </div>
            </div>
            
            <div class="form-group row">
                <div class="col-sm-8 offset-sm-2">
                    <button type="submit" class="btn btn-success mr-2">提交</button>
                    <button type="button" class="btn btn-danger">关闭</button>
                </div>
            </div>
        </form>
    </div>

    <script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>